# Contributor: Damian Kurek <starfire24680@gmail.com>
# Maintainer: Damian Kurek <starfire24680@gmail.com>
pkgname=kodi-audioencoder-flac
pkgver=19.0.1
_realname=Matrix
pkgrel=0
pkgdesc="Flac encoder addon for Kodi"
options="!check" # no test suite
url="https://github.com/xbmc/audioencoder.flac"
arch="x86 x86_64 aarch64 armv7" # kodi
license="GPL-2.0-only"
makedepends="cmake flac-dev kodi-dev"
source="$pkgname-$pkgver-$_realname.tar.gz::https://github.com/xbmc/audioencoder.flac/archive/$pkgver-$_realname.tar.gz"
builddir="$srcdir/audioencoder.flac-$pkgver-$_realname"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_MODULE_PATH=/usr/lib/cmake/kodi \
		-DUSE_LTO=1
	make -C build
}

package() {
	make -C build DESTDIR="$pkgdir" install
}

sha512sums="
a66ba93ce94221ba5a6df7db49028534e190c040739c05d3249c7a5a5cf1927286733399a3ef8a341890bd18155b02129b62d65419db4646677df0aafea118b3  kodi-audioencoder-flac-19.0.1-Matrix.tar.gz
"
